unit BBlioteca;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Menus, ExtCtrls, Buttons, jpeg, DB, DBTables, DBXpress,
  FMTBcd, DBClient, Provider, SqlExpr, Mask, DBCtrls, Grids, DBGrids, ADODB;

type
  Tfrm_principal = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    MainMenu1: TMainMenu;
    Cadastro1: TMenuItem;
    lbl_hora_atual: TLabel;
    Image1: TImage;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    SpeedButton5: TSpeedButton;
    Consulta1: TMenuItem;
    Consulta2: TMenuItem;
    N1: TMenuItem;
    SpeedButton1: TSpeedButton;
    CadastrarNovoUsuario1: TMenuItem;
    Novoaluguel1: TMenuItem;
    Registro1: TMenuItem;
    Aluguel1: TMenuItem;
    Financeiro1: TMenuItem;
    Label1: TLabel;
    LUsuario: TLabel;
    NovoLivro1: TMenuItem;
    Devolues1: TMenuItem;
    Livros1: TMenuItem;
    Relatorios1: TMenuItem;
    Emprstimos1: TMenuItem;
    Historicodealuguel1: TMenuItem;
    procedure NovoLivro1Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure CadastrarNovoUsuario1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure SpeedButton2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frm_principal: Tfrm_principal;

implementation

{$R *.dfm}
uses
unt_login,unt_cadastro_usuario, unt_cadastro_livro;

procedure Tfrm_principal.CadastrarNovoUsuario1Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_cadastro_usuario,frm_cadastro_usuario);
end;

procedure Tfrm_principal.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;
end;

procedure Tfrm_principal.FormCreate(Sender: TObject);
begin
lbl_hora_atual.caption:=FormatDateTime('dd/mm/yyyy' , Now);
LUsuario.Caption := frm_login.ed_login.Text;
end;

procedure Tfrm_principal.NovoLivro1Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_cadastro_livros,frm_cadastro_livros);
end;

procedure Tfrm_principal.SpeedButton2Click(Sender: TObject);
begin
close;
frm_login.close;
end;

procedure Tfrm_principal.SpeedButton4Click(Sender: TObject);
begin
CadastrarNovoUsuario1Click(self);
end;

end.
